home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-18 | 996 b | 46 lines | [TEXT/MPS ] |
- // volumeinfo.cp
-
- #define SystemSevenOrLater 1
-
- #include <errors.h>
- #include <memory.h>
-
- #ifndef volumeinfo_h
- #include "volumeinfo.h"
- #endif
-
- volumeinfo::volumeinfo( const Str31& name )
- {
- for ( int i=0; i<=name[0]; i++ )
- thename[i]= name[i];
- if ( thename[thename[0]] != ':' )
- thename[++thename[0]]= ':';
-
- pb.volumeParam.ioCompletion= 0;
- pb.volumeParam.ioNamePtr= (StringPtr)&thename;
- pb.volumeParam.ioVRefNum= 0;
- pb.volumeParam.ioVolIndex= -1;
- error= PBHGetVInfoSync( &pb );
- }
-
- volumeinfo::volumeinfo( int16 refnum )
- {
- pb.volumeParam.ioCompletion= 0;
- pb.volumeParam.ioNamePtr= (StringPtr)&thename;
- thename[0]= 0;
- pb.volumeParam.ioVRefNum= refnum;
- pb.volumeParam.ioVolIndex= 0;
- error= PBHGetVInfoSync( &pb );
- }
-
- boolean volumeinfo::nth( uint16 n )
- {
- pb.volumeParam.ioCompletion= 0;
- pb.volumeParam.ioNamePtr= (StringPtr)&thename;
- thename[0]= 0;
- pb.volumeParam.ioVRefNum= 0;
- pb.volumeParam.ioVolIndex= n;
- error= PBHGetVInfoSync( &pb );
- return error != nsvErr;
- }
-